﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace AnimalWars2
{
    public class HumanPlayer : Player
    {
        public Keys MoveLeftKey;
        public Keys MoveRightKey;
        public Keys ActionKey;

        public HumanPlayer(GameTable gameTableRef, Texture2D texture, Vector2 position, Vector2 velocity, Keys left, Keys right, Keys action, PlayerSide side)
            : base(gameTableRef, texture, position, velocity, side)
        {
            MoveLeftKey = left;
            MoveRightKey = right;
            ActionKey = action;
        }

        public override bool MoveLeft()
        {
            KeyboardState oKS = Keyboard.GetState();
            return oKS.IsKeyDown(MoveLeftKey);
        }

        public override bool MoveRight()
        {
            KeyboardState oKS = Keyboard.GetState();
            return oKS.IsKeyDown(MoveRightKey);
        }

        public override bool Action()
        {
            KeyboardState oKS = Keyboard.GetState();
            return oKS.IsKeyDown(ActionKey);
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            base.Draw(gameTime, spriteBatch);

            spriteBatch.Draw(m_Texture, new Vector2(329.0f, 43.0f), null, Color.White, 0.0f, new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, 0.5f);
        }
    }
}
